home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Text / Show / Less / less-252 / less.man < prev    next >
Text File  |  1994-11-01  |  52KB  |  1,453 lines

  1.  
  2.  
  3.  
  4. LESS(1)                  USER COMMANDS                    LESS(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      less - opposite of more
  10.  
  11. SYNOPSIS
  12.      less -?
  13.      less -V
  14.      less [-[+]aBcCdeEfHimMnNqQrsSuUw]
  15.           [-b _b_u_f_s] [-h _l_i_n_e_s] [-j _l_i_n_e] [-k _k_e_y_f_i_l_e]
  16.           [-{oO} _l_o_g_f_i_l_e] [-p _p_a_t_t_e_r_n] [-P _p_r_o_m_p_t] [-t _t_a_g]
  17.           [-T _t_a_g_f_i_l_e] [-x _t_a_b] [-y _l_i_n_e_s] [-[z] _l_i_n_e_s]
  18.           [+[+]_c_m_d] [_f_i_l_e_n_a_m_e]...
  19.  
  20.  
  21. DESCRIPTION
  22.      _L_e_s_s is a program similar to  _m_o_r_e  (1),  but  which  allows
  23.      backward  movement  in the file as well as forward movement.
  24.      Also, _l_e_s_s does not have  to  read  the  entire  input  file
  25.      before starting, so with large input files it starts up fas-
  26.      ter than text editors like _v_i (1).  _L_e_s_s  uses  termcap  (or
  27.      terminfo  on  some  systems),  so it can run on a variety of
  28.      terminals.  There is even limited support for hardcopy  ter-
  29.      minals.   (On  a  hardcopy  terminal,  lines which should be
  30.      printed at the top of the screen are prefixed with a caret.)
  31.  
  32.      Commands are based on both _m_o_r_e and _v_i. Commands may be pre-
  33.      ceded  by  a  decimal  number,  called N in the descriptions
  34.      below.  The number is used by some commands, as indicated.
  35.  
  36.  
  37. COMMANDS
  38.      In the following  descriptions,  ^X  means  control-X.   ESC
  39.      stands  for  the ESCAPE key; for example ESC-v means the two
  40.      character sequence "ESCAPE", then "v".
  41.  
  42.      h or H
  43.           Help: display a summary of these commands.  If you for-
  44.           get all the other commands, remember this one.
  45.  
  46.      SPACE or ^V or f or ^F
  47.           Scroll forward N lines, default one window (see  option
  48.           -z below).  If N is more than the screen size, only the
  49.           final screenful is displayed.   Warning:  some  systems
  50.           use ^V as a special literalization character.
  51.  
  52.      z    Like SPACE, but if N is specified, it becomes  the  new
  53.           window size.
  54.  
  55.      RETURN or ^N or e or ^E or j or ^J
  56.           Scroll forward N lines, default 1.  The entire N  lines
  57.           are displayed, even if N is more than the screen size.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                 1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LESS(1)                  USER COMMANDS                    LESS(1)
  71.  
  72.  
  73.  
  74.      d or ^D
  75.           Scroll forward N lines, default one half of the  screen
  76.           size.   If  N  is specified, it becomes the new default
  77.           for subsequent d and u commands.
  78.  
  79.      b or ^B or ESC-v
  80.           Scroll backward N lines, default one window (see option
  81.           -z below).  If N is more than the screen size, only the
  82.           final screenful is displayed.
  83.  
  84.      w    Like ESC-v, but if N is specified, it becomes  the  new
  85.           window size.
  86.  
  87.      y or ^Y or ^P or k or ^K
  88.           Scroll backward N lines, default 1.  The entire N lines
  89.           are  displayed, even if N is more than the screen size.
  90.           Warning: some systems use ^Y as a special  job  control
  91.           character.
  92.  
  93.      u or ^U
  94.           Scroll backward N lines, default one half of the screen
  95.           size.   If  N  is specified, it becomes the new default
  96.           for subsequent d and u commands.
  97.  
  98.      r or ^R or ^L
  99.           Repaint the screen.
  100.  
  101.      R    Repaint the  screen,  discarding  any  buffered  input.
  102.           Useful  if  the  file  is  changing  while  it is being
  103.           viewed.
  104.  
  105.      F    Scroll forward, and keep trying to read when the end of
  106.           file  is  reached.  Normally this command would be used
  107.           when already at the end of the file.  It is  a  way  to
  108.           monitor the tail of a file which is growing while it is
  109.           being viewed.  (The behavior is similar  to  the  "tail
  110.           -f" command.)
  111.  
  112.      g or < or ESC-<
  113.           Go to line N in  the  file,  default  1  (beginning  of
  114.           file).  (Warning: this may be slow if N is large.)
  115.  
  116.      G or > or ESC->
  117.           Go to line N in the file, default the end of the  file.
  118.           (Warning:  this  may  be slow if N is large, or if N is
  119.           not specified and standard input, rather than  a  file,
  120.           is being read.)
  121.  
  122.      p or %
  123.           Go to a position N percent into the file.  N should  be
  124.           between  0  and  100.  (This works if standard input is
  125.           being read, but only if _l_e_s_s has already  read  to  the
  126.  
  127.  
  128.  
  129.                                                                 2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. LESS(1)                  USER COMMANDS                    LESS(1)
  137.  
  138.  
  139.  
  140.           end  of  the  file.   It is always fast, but not always
  141.           useful.)
  142.  
  143.      {    If a  left  curly  bracket  appears  in  the  top  line
  144.           displayed  on  the screen, the { command will go to the
  145.           matching right curly bracket.  The matching right curly
  146.           bracket is positioned on the bottom line of the screen.
  147.           If there is more than one left curly bracket on the top
  148.           line,  a  number  N  may  be  used  to specify the N-th
  149.           bracket on the line.
  150.  
  151.      }    If a right curly bracket appears  in  the  bottom  line
  152.           displayed  on  the screen, the } command will go to the
  153.           matching left curly bracket.  The matching  left  curly
  154.           bracket  is  positioned  on the top line of the screen.
  155.           If there is more than one right curly  bracket  on  the
  156.           top  line,  a  number N may be used to specify the N-th
  157.           bracket on the line.
  158.  
  159.      (    Like {, but applies to parentheses  rather  than  curly
  160.           brackets.
  161.  
  162.      )    Like }, but applies to parentheses  rather  than  curly
  163.           brackets.
  164.  
  165.      [    Like {, but applies  to  square  brackets  rather  than
  166.           curly brackets.
  167.  
  168.      ]    Like }, but applies  to  square  brackets  rather  than
  169.           curly brackets.
  170.  
  171.      ESC-^F
  172.           Followed by two characters, acts like {, but  uses  the
  173.           two  characters  as  open  and  close brackets, respec-
  174.           tively.  For example, "ESC ^F < >" could be used to  go
  175.           forward  to  the  >  which  matches  the  <  in the top
  176.           displayed line.
  177.  
  178.      ESC-^B
  179.           Followed by two characters, acts like }, but  uses  the
  180.           two  characters  as  open  and  close brackets, respec-
  181.           tively.  For example, "ESC ^B < >" could be used to  go
  182.           backward  to  the  <  which matches the > in the bottom
  183.           displayed line.
  184.  
  185.      m    Followed by any lowercase  letter,  marks  the  current
  186.           position with that letter.
  187.  
  188.      '    (Single  quote.)  Followed  by  any  lowercase  letter,
  189.           returns  to  the  position  which was previously marked
  190.           with that letter.  Followed by  another  single  quote,
  191.           returns  to  the  position  at  which  the last "large"
  192.  
  193.  
  194.  
  195.                                                                 3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. LESS(1)                  USER COMMANDS                    LESS(1)
  203.  
  204.  
  205.  
  206.           movement command was executed.  Followed by a ^  or  $,
  207.           jumps to the beginning or end of the file respectively.
  208.           Marks are preserved when a new file is examined, so the
  209.           ' command can be used to switch between input files.
  210.  
  211.      ^X^X Same as single quote.
  212.  
  213.      /pattern
  214.           Search forward in the file for the N-th line containing
  215.           the  pattern.  N defaults to 1.  The pattern is a regu-
  216.           lar expression, as recognized by _e_d. The search  starts
  217.           at  the  second  line  displayed (but see the -a and -j
  218.           options, which change this).
  219.  
  220.           Certain characters are special if entered at the begin-
  221.           ning  of  the  pattern;  they modify the type of search
  222.           rather than become part of the pattern:
  223.  
  224.           !    Search for lines which do NOT match the pattern.
  225.  
  226.           *    Search multiple files.  That  is,  if  the  search
  227.                reaches  the end of the current file without find-
  228.                ing a match, the search continues in the next file
  229.                in the command line list.
  230.  
  231.           @    Begin the search at the first line  of  the  first
  232.                file  in the command line list, regardless of what
  233.                is currently displayed on the screen or  the  set-
  234.                tings of the -a or -j options.
  235.  
  236.      ?pattern
  237.           Search backward in the file for the N-th line  contain-
  238.           ing the pattern.  The search starts at the line immedi-
  239.           ately before the top line displayed.
  240.  
  241.           Certain characters are special as in the / command:
  242.  
  243.           !    Search for lines which do NOT match the pattern.
  244.  
  245.           *    Search multiple files.  That  is,  if  the  search
  246.                reaches  the beginning of the current file without
  247.                finding a match, the search continues in the  pre-
  248.                vious file in the command line list.
  249.  
  250.           @    Begin the search at the last line of the last file
  251.                in  the  command  line list, regardless of what is
  252.                currently displayed on the screen or the  settings
  253.                of the -a or -j options.
  254.  
  255.      ESC-/pattern
  256.           Same as "/*".
  257.  
  258.  
  259.  
  260.  
  261.                                                                 4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. LESS(1)                  USER COMMANDS                    LESS(1)
  269.  
  270.  
  271.  
  272.      ESC-?pattern
  273.           Same as "?*".
  274.  
  275.      n    Repeat previous search, for N-th  line  containing  the
  276.           last  pattern.   If the previous search was modified by
  277.           !, the search is made for the N-th line NOT  containing
  278.           the pattern.  If the previous search was modified by *,
  279.           the search continues in the next (or previous) file  if
  280.           not  satisfied in the current file.  There is no effect
  281.           if the previous search was modified by @.
  282.  
  283.      N    Repeat previous search, but in the reverse direction.
  284.  
  285.      ESC-n
  286.           Repeat previous search, but crossing  file  boundaries.
  287.           The  effect  is as if the previous search were modified
  288.           by *.
  289.  
  290.      ESC-N
  291.           Repeat previous search, but in  the  reverse  direction
  292.           and crossing file boundaries.
  293.  
  294.      ESC-u
  295.           Undo search highlighting.   Turn  off  highlighting  of
  296.           strings   matching   the  current  search  pattern.  If
  297.           highlighting is already off because of a previous ESC-u
  298.           command, turn highlighting back on.  Any search command
  299.           will also turn highlighting back on.  (Highlighting can
  300.           also  be disabled by toggling the -F flag; in that case
  301.           search commands do not turn highlighting back on.)
  302.  
  303.      :e [filename]
  304.           Examine a new file.  If the filename  is  missing,  the
  305.           "current"  file (see the :n and :p commands below) from
  306.           the list of files in the command line  is  re-examined.
  307.           A  percent  sign (%) in the filename is replaced by the
  308.           name of the current file. A pound sign (#) is  replaced
  309.           by  the  name  of  the  previously  examined file.  The
  310.           filename is inserted into  the  command  line  list  of
  311.           files  so  that  it can be seen by subsequent :n and :p
  312.           commands.  If the filename consists of  several  files,
  313.           they  are  all  inserted into the list of files and the
  314.           first one is examined.
  315.  
  316.      ^X^V or E
  317.           Same as :e.  Warning: some systems use ^V as a  special
  318.           literalization character.
  319.  
  320.      :n   Examine the next file (from the list of files given  in
  321.           the  command line).  If a number N is specified, the N-
  322.           th next file is examined.
  323.  
  324.  
  325.  
  326.  
  327.                                                                 5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. LESS(1)                  USER COMMANDS                    LESS(1)
  335.  
  336.  
  337.  
  338.      :p   Examine the previous file in the command line list.  If
  339.           a  number  N  is  specified,  the N-th previous file is
  340.           examined.
  341.  
  342.      :x   Examine the first file in the command line list.  If  a
  343.           number  N  is  specified,  the N-th file in the list is
  344.           examined.
  345.  
  346.      = or ^G or :f
  347.           Prints some information about the  file  being  viewed,
  348.           including  its name and the line number and byte offset
  349.           of the bottom line being displayed.   If  possible,  it
  350.           also prints the length of the file, the number of lines
  351.           in the file and the percent of the file above the  last
  352.           displayed line.
  353.  
  354.      -    Followed by one of the command line option letters (see
  355.           below), this will change the setting of that option and
  356.           print a message describing the  new  setting.   If  the
  357.           option  letter  has a numeric value (such as -b or -h),
  358.           or a string value (such as -P or -t), a new  value  may
  359.           be entered after the option letter.  If no new value is
  360.           entered, a message describing the  current  setting  is
  361.           printed and nothing is changed.
  362.  
  363.      -+   Followed by one of the command line option letters (see
  364.           below),  this will reset the option to its default set-
  365.           ting and print a message describing  the  new  setting.
  366.           (The  "-+_X" command does the same thing as "-+_X" on the
  367.           command line.) This does  not  work  for  string-valued
  368.           options.
  369.  
  370.      --   Followed by one of the command line option letters (see
  371.           below), this will reset the option to the "opposite" of
  372.           its default setting and print a message describing  the
  373.           new setting.  (The "--_X" command does the same thing as
  374.           "-_X" on the command  line.)  This  does  not  work  for
  375.           numeric or string-valued options.
  376.  
  377.      _    (Underscore.) Followed  by  one  of  the  command  line
  378.           option  letters  (see below), this will print a message
  379.           describing the current setting  of  that  option.   The
  380.           setting of the option is not changed.
  381.  
  382.      +cmd Causes the specified cmd to be executed each time a new
  383.           file  is examined.  For example, +G causes _l_e_s_s to ini-
  384.           tially display each file starting  at  the  end  rather
  385.           than the beginning.
  386.  
  387.      V    Prints the version number of _l_e_s_s being run.
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                 6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. LESS(1)                  USER COMMANDS                    LESS(1)
  401.  
  402.  
  403.  
  404.      q or :q or :Q or ZZ
  405.           Exits _l_e_s_s.
  406.  
  407.      The following three  commands  may  or  may  not  be  valid,
  408.      depending on your particular installation.
  409.  
  410.      v    Invokes an  editor  to  edit  the  current  file  being
  411.           viewed.  The editor is taken from the environment vari-
  412.           able EDITOR, or defaults to "vi".  See also the discus-
  413.           sion of LESSEDIT under the section on PROMPTS below.
  414.  
  415.      ! shell-command
  416.           Invokes a shell to run the shell-command given.  A per-
  417.           cent sign (%) in the command is replaced by the name of
  418.           the current file. A pound sign (#) is replaced  by  the
  419.           name of the previously examined file.  "!!" repeats the
  420.           last shell command.  "!" with no shell  command  simply
  421.           invokes a shell.  In all cases, the shell is taken from
  422.           the environment variable SHELL, or defaults to "sh".
  423.  
  424.      | <m> shell-command
  425.           <m> represents any mark letter.  Pipes a section of the
  426.           input  file to the given shell command.  The section of
  427.           the file to be piped is between the first line  on  the
  428.           current  screen  and the position marked by the letter.
  429.           <m> may also be ^ or $ to indicate beginning or end  of
  430.           file respectively.  If <m> is . or newline, the current
  431.           screen is piped.
  432.  
  433. OPTIONS
  434.      Command line options are described below.  Most options  may
  435.      be changed while _l_e_s_s is running, via the "-" command.
  436.  
  437.      Options are also taken from the environment variable "LESS".
  438.      For  example,  to avoid typing "less -options ..." each time
  439.      _l_e_s_s is invoked, you might tell _c_s_h:
  440.  
  441.      setenv LESS "-options"
  442.  
  443.      or if you use _s_h:
  444.  
  445.      LESS="-options"; export LESS
  446.  
  447.      The environment variable is parsed before the command  line,
  448.      so  command line options override the LESS environment vari-
  449.      able.  If an option appears in the LESS variable, it can  be
  450.      reset  to  its  default on the command line by beginning the
  451.      command line option with "-+".
  452.  
  453.      A dollar sign ($) may be used to signal the end of an option
  454.      string.   This  is  important only for options like -P which
  455.      take a following string.
  456.  
  457.  
  458.  
  459.                                                                 7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. LESS(1)                  USER COMMANDS                    LESS(1)
  467.  
  468.  
  469.  
  470.      -?   This option displays a summary of the commands accepted
  471.           by _l_e_s_s (the same as the h command).  If this option is
  472.           given, all other options are ignored,  and  _l_e_s_s  exits
  473.           after  the  help  screen  is viewed.  (Depending on how
  474.           your shell interprets the  question  mark,  it  may  be
  475.           necessary to quote the question mark, thus: "-\?".)
  476.  
  477.      -a   Causes searches to start after the last line  displayed
  478.           on the screen, thus skipping all lines displayed on the
  479.           screen.  By default, searches start at the second  line
  480.           on the screen (or after the last found line; see the -j
  481.           option).
  482.  
  483.      -b_n  Causes _l_e_s_s to use a non-standard  number  of  buffers.
  484.           Buffers  are  1K,  and  by  default 10 buffers are used
  485.           (except if data in coming from standard input; see  the
  486.           -B  option).  The number _n specifies a different number
  487.           of buffers to use.
  488.  
  489.      -B   Disables automatic allocation of buffers, so that  only
  490.           the  default  number of buffers are used.  If more data
  491.           is read than will fit in the buffers, the  oldest  data
  492.           is  discarded.   By  default,  when data is coming from
  493.           standard input, buffers are allocated automatically  as
  494.           needed to avoid loss of data.
  495.  
  496.      -c   Causes full screen repaints to be painted from the  top
  497.           line  down.   By default, full screen repaints are done
  498.           by scrolling from the bottom of the screen.
  499.  
  500.      -C   The -C option is like -c, but  the  screen  is  cleared
  501.           before it is repainted.
  502.  
  503.      -d   The -d option suppresses  the  error  message  normally
  504.           displayed  if the terminal is dumb; that is, lacks some
  505.           important capability, such as the ability to clear  the
  506.           screen or scroll backward.  The -d option does not oth-
  507.           erwise change the behavior of _l_e_s_s on a dumb terminal).
  508.  
  509.      -Dx_c_o_l_o_r
  510.           [MS-DOS only] Sets the color of the text displayed.   x
  511.           is  a  single  character which selects the type of text
  512.           whose color is being set: n=normal, s=standout, d=bold,
  513.           u=underlined,  k=blink.   _c_o_l_o_r  is  a  pair of numbers
  514.           separated by a period. The  first  number  selects  the
  515.           foreground  color and the second selects the background
  516.           color of the text.  A single number _N is  the  same  as
  517.           _N._0.
  518.  
  519.      -e   Causes _l_e_s_s to automatically exit the  second  time  it
  520.           reaches  end-of-file.  By default, the only way to exit
  521.           _l_e_s_s is via the "q" command.
  522.  
  523.  
  524.  
  525.                                                                 8
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. LESS(1)                  USER COMMANDS                    LESS(1)
  533.  
  534.  
  535.  
  536.      -E   Causes _l_e_s_s to automatically exit  the  first  time  it
  537.           reaches end-of-file.
  538.  
  539.      -f   Forces non-regular files to be opened.  (A  non-regular
  540.           file  is  a  directory  or a device special file.) Also
  541.           suppresses the warning message when a  binary  file  is
  542.           opened.   By  default,  _l_e_s_s  will  refuse to open non-
  543.           regular files.
  544.  
  545.      -F   Normally, _l_e_s_s will highlight all strings  which  match
  546.           the current search pattern, by displaying them in stan-
  547.           dout mode.  The -F flag suppresses this highlighting.
  548.  
  549.      -h_n  Specifies a maximum number of lines to scroll backward.
  550.           If  it  is  necessary  to  scroll  backward more than _n
  551.           lines, the screen is repainted in a  forward  direction
  552.           instead.  (If the terminal does not have the ability to
  553.           scroll backward, -h0 is implied.)
  554.  
  555.      -i   Causes searches to ignore case; that is, uppercase  and
  556.           lowercase  are  considered  identical.   This option is
  557.           ignored if any uppercase letters appear in  the  search
  558.           pattern.
  559.  
  560.      -j_n  Specifies a line on the screen where "target" lines are
  561.           to  be positioned.  Target lines are the object of text
  562.           searches, tag searches, jumps to a line  number,  jumps
  563.           to  a  file percentage, and jumps to a marked position.
  564.           The screen line is specified by a number: the top  line
  565.           on  the  screen  is  1,  the next is 2, and so on.  The
  566.           number may be negative to specify a  line  relative  to
  567.           the bottom of the screen: the bottom line on the screen
  568.           is -1, the second to the bottom is -2, and so  on.   If
  569.           the  -j  option  is  used,  searches  begin at the line
  570.           immediately after the target line.  For example, if  "-
  571.           j4"  is used, the target line is the fourth line on the
  572.           screen, so searches begin at  the  fifth  line  on  the
  573.           screen.
  574.  
  575.      -k_f_i_l_e_n_a_m_e
  576.           Causes _l_e_s_s to open and interpret the named file  as  a
  577.           _l_e_s_s_k_e_y  (1)  file.   Multiple -k options may be speci-
  578.           fied.  If a file called .less exists in the user's home
  579.           directory, this file is also used as a _l_e_s_s_k_e_y file.
  580.  
  581.      -m   Causes _l_e_s_s to prompt verbosely (like _m_o_r_e),  with  the
  582.           percent into the file.  By default, _l_e_s_s prompts with a
  583.           colon.
  584.  
  585.      -M   Causes _l_e_s_s to prompt even more verbosely than _m_o_r_e.
  586.  
  587.      -n   Suppresses line numbers.   The  default  (to  use  line
  588.  
  589.  
  590.  
  591.                                                                 9
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. LESS(1)                  USER COMMANDS                    LESS(1)
  599.  
  600.  
  601.  
  602.           numbers)  may  cause  _l_e_s_s  to  run more slowly in some
  603.           cases,  especially  with  a  very  large  input   file.
  604.           Suppressing  line  numbers  with the -n flag will avoid
  605.           this problem.   Using  line  numbers  means:  the  line
  606.           number  will  be displayed in the verbose prompt and in
  607.           the = command, and the v command will pass the  current
  608.           line  number  to the editor (see also the discussion of
  609.           LESSEDIT in PROMPTS below).
  610.  
  611.      -N   Causes a line number to be displayed at  the  beginning
  612.           of each line in the display.
  613.  
  614.      -o_f_i_l_e_n_a_m_e
  615.           Causes _l_e_s_s to copy its input to the named file  as  it
  616.           is being viewed.  This applies only when the input file
  617.           is a pipe, not an ordinary file.  If the  file  already
  618.           exists, _l_e_s_s will ask for confirmation before overwrit-
  619.           ing it.
  620.  
  621.      -O_f_i_l_e_n_a_m_e
  622.           The -O option is like -o,  but  it  will  overwrite  an
  623.           existing file without asking for confirmation.
  624.  
  625.           If no log file  has  been  specified,  the  -o  and  -O
  626.           options  can  be used from within _l_e_s_s to specify a log
  627.           file.  Without a file name, they will simply report the
  628.           name of the log file.  The "s" command is equivalent to
  629.           specifying -o from within _l_e_s_s.
  630.  
  631.      -p_p_a_t_t_e_r_n
  632.           The -p option on the  command  line  is  equivalent  to
  633.           specifying  +/_p_a_t_t_e_r_n;  that is, it tells _l_e_s_s to start
  634.           at the first occurence of _p_a_t_t_e_r_n in the file.
  635.  
  636.      -P_p_r_o_m_p_t
  637.           Provides a way to tailor the  three  prompt  styles  to
  638.           your own preference.  This option would normally be put
  639.           in the LESS environment  variable,  rather  than  being
  640.           typed  in  with each _l_e_s_s command.  Such an option must
  641.           either be the last option in the LESS variable,  or  be
  642.           terminated  by  a dollar sign.  -P followed by a string
  643.           changes the default (short) prompt to that string.  -Pm
  644.           changes  the  medium (-m) prompt to the string, and -PM
  645.           changes the long (-M) prompt.  Also,  -P=  changes  the
  646.           message  printed  by the = command to the given string.
  647.           All prompt strings consist of a sequence of letters and
  648.           special  escape  sequences.  See the section on PROMPTS
  649.           for more details.
  650.  
  651.      -q   Causes moderately "quiet" operation: the terminal  bell
  652.           is  not  rung  if an attempt is made to scroll past the
  653.           end of the file or before the beginning  of  the  file.
  654.  
  655.  
  656.  
  657.                                                                10
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. LESS(1)                  USER COMMANDS                    LESS(1)
  665.  
  666.  
  667.  
  668.           If  the  terminal  has  a  "visual  bell",  it  is used
  669.           instead.  The  bell  will  be  rung  on  certain  other
  670.           errors,  such  as  typing  an  invalid  character.  The
  671.           default is to ring the terminal bell in all such cases.
  672.  
  673.      -Q   Causes totally "quiet" operation: the terminal bell  is
  674.           never rung.
  675.  
  676.      -r   Causes "raw" control characters to be  displayed.   The
  677.           default  is  to  display  control  characters using the
  678.           caret notation; for example, a control-A (octal 001) is
  679.           displayed  as "^A".  Warning: when the -r flag is used,
  680.           _l_e_s_s cannot keep track of the actual appearance of  the
  681.           screen  (since  this depends on how the screen responds
  682.           to each type  of  control  character).   Thus,  various
  683.           display  problems  may result, such as long lines being
  684.           split in the wrong place.
  685.  
  686.      -s   Causes consecutive blank lines to be  squeezed  into  a
  687.           single  blank  line.  This is useful when viewing _n_r_o_f_f
  688.           output.
  689.  
  690.      -S   Causes lines longer than the screen width to be chopped
  691.           rather  than  folded.  That is, the remainder of a long
  692.           line is simply discarded.  The default is to fold  long
  693.           lines; that is, display the remainder on the next line.
  694.  
  695.      -t_t_a_g
  696.           The -t option, followed immediately by a TAG, will edit
  697.           the  file containing that tag.  For this to work, there
  698.           must be a file called "tags" in the current  directory,
  699.           which  was  previously  built by the _c_t_a_g_s (1) command.
  700.           This option may also  be  specified  from  within  _l_e_s_s
  701.           (using the - command) as a way of examining a new file.
  702.           The command ":t" is equivalent to  specifying  -t  from
  703.           within _l_e_s_s.
  704.  
  705.      -T_t_a_g_s_f_i_l_e
  706.           Specifies a tags file to be used instead of "tags".
  707.  
  708.      -u   Causes backspaces and carriage returns to be treated as
  709.           printable  characters;  that  is,  they are sent to the
  710.           terminal when they appear in the input.
  711.  
  712.      -U   Causes backspaces and carriage returns to be treated as
  713.           control characters; that is, they are handled as speci-
  714.           fied by the -r option.
  715.  
  716.           By default, if neither -u nor -U is  given,  backspaces
  717.           which  appear  adjacent  to an underscore character are
  718.           treated specially: the  underlined  text  is  displayed
  719.           using  the  terminal's hardware underlining capability.
  720.  
  721.  
  722.  
  723.                                                                11
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. LESS(1)                  USER COMMANDS                    LESS(1)
  731.  
  732.  
  733.  
  734.           Also, backspaces which  appear  between  two  identical
  735.           characters  are  treated specially: the overstruck text
  736.           is printed using the terminal's hardware boldface capa-
  737.           bility.   Other  backspaces are deleted, along with the
  738.           preceding character.  Carriage returns immediately fol-
  739.           lowed by a newline are deleted.  Other carriage returns
  740.           are handled as specified by the -r option.  Text  which
  741.           is overstruck or underlined can be searched for.
  742.  
  743.      -V   Displays the version number of _l_e_s_s.
  744.  
  745.      -w   Causes blank lines to be used to represent  lines  past
  746.           the  end of the file.  By default, a tilde character is
  747.           used.
  748.  
  749.      -x_n  Sets tab stops every _n positions.  The default for _n is
  750.           8.
  751.  
  752.      -X   Disables sending the termcap initialization and  deini-
  753.           tialization strings to the terminal.  This is sometimes
  754.           desirable if the deinitialization string does something
  755.           unnecessary, like clearing the screen.
  756.  
  757.      -y_n  Specifies a maximum number of lines to scroll  forward.
  758.           If it is necessary to scroll forward more than _n lines,
  759.           the screen is repainted instead.  The -c or  -C  option
  760.           may  be  used  to repaint from the top of the screen if
  761.           desired.   By  default,  any  forward  movement  causes
  762.           scrolling.
  763.  
  764.      -[z]_n
  765.           Changes the default scrolling window size to  _n  lines.
  766.           The default is one screenful.  The z and w commands can
  767.           also be used to change the window size.  The "z" may be
  768.           omitted for compatibility with _m_o_r_e. If the number _n is
  769.           negative, it indicates _n lines less  than  the  current
  770.           screen  size.   For example, if the screen is 24 lines,
  771.           -_z-_4 sets the scrolling window to  20  lines.   If  the
  772.           screen  is  resized  to  40 lines, the scrolling window
  773.           automatically changes to 36 lines.
  774.  
  775.      +    If a command line option begins with +,  the  remainder
  776.           of  that  option  is  taken to be an initial command to
  777.           _l_e_s_s. For example, +G tells _l_e_s_s to start at the end of
  778.           the  file rather than the beginning, and +/xyz tells it
  779.           to start at the first occurrence of "xyz" in the  file.
  780.           As a special case, +<number> acts like +<number>g; that
  781.           is, it starts the display at the specified line  number
  782.           (however,  see the caveat under the "g" command above).
  783.           If the option  starts  with  ++,  the  initial  command
  784.           applies  to every file being viewed, not just the first
  785.           one.  The + command described previously  may  also  be
  786.  
  787.  
  788.  
  789.                                                                12
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. LESS(1)                  USER COMMANDS                    LESS(1)
  797.  
  798.  
  799.  
  800.           used  to  set  (or change) an initial command for every
  801.           file.
  802.  
  803.  
  804. LINE EDITING
  805.      When entering command line at the bottom of the screen  (for
  806.      example, a filename for the :e command, or the pattern for a
  807.      search command), certain keys can be used to manipulate  the
  808.      command  line.   Most  commands  have an alternate form in [
  809.      brackets ] which can be used if a key does not  exist  on  a
  810.      particular keyboard. (The bracketed forms do not work in the
  811.      MS-DOS version.) Any of these special keys  may  be  entered
  812.      literally  by  preceding  it  with  the "literal" character,
  813.      either ^V or ^A.  A backslash itself  may  also  be  entered
  814.      literally by entering two backslashes.
  815.  
  816.      LEFTARROW [ ESC-h ]
  817.           Move the cursor one space to the left.
  818.  
  819.      RIGHTARROW [ ESC-l ]
  820.           Move the cursor one space to the right.
  821.  
  822.      ^LEFTARROW [ ESC-b or ESC-LEFTARROW ]
  823.           (That is, CONTROL and LEFTARROW  simultaneously.)  Move
  824.           the cursor one word to the left.
  825.  
  826.      ^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ]
  827.           (That is, CONTROL and RIGHTARROW simultaneously.)  Move
  828.           the cursor one word to the right.
  829.  
  830.      HOME [ ESC-0 ]
  831.           Move the cursor to the beginning of the line.
  832.  
  833.      END [ ESC-$ ]
  834.           Move the cursor to the end of the line.
  835.  
  836.      BACKSPACE
  837.           Delete the char to the left of the  cursor,  or  cancel
  838.           the command if the command line is empty.
  839.  
  840.      DELETE or [ ESC-x ]
  841.           Delete the char under the cursor.
  842.  
  843.      ^BACKSPACE [ ESC-BACKSPACE ]
  844.           (That is, CONTROL and BACKSPACE simultaneously.) Delete
  845.           the word to the left of the cursor.
  846.  
  847.      ^DELETE [ ESC-X or ESC-DELETE ]
  848.           (That is, CONTROL and  DELETE  simultaneously.)  Delete
  849.           the word under the cursor.
  850.  
  851.      UPARROW [ ESC-k ]
  852.  
  853.  
  854.  
  855.                                                                13
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. LESS(1)                  USER COMMANDS                    LESS(1)
  863.  
  864.  
  865.  
  866.           Retrieve the previous command line.
  867.  
  868.      DOWNARROW [ ESC-j ]
  869.           Retrieve the next command line.
  870.  
  871.      TAB  Complete the partial filename to the left of  the  cur-
  872.           sor.   If  it matches more than one filename, the first
  873.           match is entered into the command line.  Repeated  TABs
  874.           will cycle thru the other matching filesnames.
  875.  
  876.      BACKTAB [ ESC-TAB ]
  877.           Like, TAB, but cycles in the reverse direction thru the
  878.           matching filenames.
  879.  
  880.      ^L   Complete the partial filename to the left of  the  cur-
  881.           sor.  If it matches more than one filename, all matches
  882.           are entered into the command line (if they fit).
  883.  
  884.      ^U (Unix) or ESC (MS-DOS)
  885.           Delete the entire command line, or cancel  the  command
  886.           if the command line is empty.  If you have changed your
  887.           line-kill character in Unix to something other than ^U,
  888.           that character is used instead of ^U.
  889.  
  890.  
  891. KEY BINDINGS
  892.      You may define your own _l_e_s_s commands by using  the  program
  893.      _l_e_s_s_k_e_y  (1)  to  create  a file called ".less" in your home
  894.      directory.  This file specifies a set of command keys and an
  895.      action  associated  with each key.  You may also use _l_e_s_s_k_e_y
  896.      to change the line-editing keys (see LINE EDITING).  See the
  897.      _l_e_s_s_k_e_y manual page for more details.
  898.  
  899.  
  900. INPUT PREPROCESSOR
  901.      You may define an "input preprocessor" for _l_e_s_s. Before _l_e_s_s
  902.      opens  a  file,  it  first  gives  your input preprocessor a
  903.      chance to modify the  way  the  contents  of  the  file  are
  904.      displayed.   An  input  preprocessor is simply an executable
  905.      program (or shell script), which writes the contents of  the
  906.      file  to a different file, called the replacement file.  The
  907.      contents of the replacement file are then displayed in place
  908.      of  the  contents  of  the  original file.  However, it will
  909.      appear to the user as if the original file is  opened;  that
  910.      is,  _l_e_s_s  will display the original filename as the name of
  911.      the current file.
  912.  
  913.      An input preprocessor receives one  command  line  argument,
  914.      the  original  filename,  as entered by the user.  It should
  915.      create the replacement file, and when  finished,  print  the
  916.      name of the replacement file to its standard output.  If the
  917.      input preprocessor does not output a  replacement  filename,
  918.  
  919.  
  920.  
  921.                                                                14
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. LESS(1)                  USER COMMANDS                    LESS(1)
  929.  
  930.  
  931.  
  932.      _l_e_s_s  uses the original file, as normal.  To set up an input
  933.      preprocessor, set the LESSOPEN  environment  variable  to  a
  934.      command  line  which  will  invoke  your input preprocessor.
  935.      This command line should include one occurence of the string
  936.      "%s",  which will be replaced by the filename when the input
  937.      preprocessor command is invoked.
  938.  
  939.      When _l_e_s_s closes a file opened in such a way, it  will  call
  940.      another  program,  called the input postprocessor, which may
  941.      perform any desired clean-up action (such  as  deleting  the
  942.      replacement   file   created  by  LESSOPEN).   This  program
  943.      receives two command line arguments, the  original  filename
  944.      as  entered  by  the  user,  and the name of the replacement
  945.      file.  To set up an input postprocessor, set  the  LESSCLOSE
  946.      environment  variable  to  a  command line which will invoke
  947.      your input postprocessor.  It may include two occurences  of
  948.      the  string  "%s";  the  first is replaced with the original
  949.      name of the file  and  the  second  with  the  name  of  the
  950.      replacement file, which was output by LESSOPEN.
  951.  
  952.      For example, on many Unix systems, these  two  scripts  will
  953.      allow  you to keep files in compressed format, but still let
  954.      _l_e_s_s view them directly (by giving _l_e_s_s the name of the file
  955.      without the .Z suffix):
  956.  
  957.      lessopen.sh:
  958.           #! /bin/sh
  959.           if [ -f "$1.Z" ]; then
  960.                uncompress -c $1.Z >$1.tmp
  961.                echo $1.tmp
  962.           fi
  963.  
  964.      lessclose.sh:
  965.           #! /bin/sh
  966.           rm $2
  967.  
  968.      To use these scripts, put them both where they can  be  exe-
  969.      cuted     and     set     LESSOPEN="lessopen.sh %s",     and
  970.      LESSCLOSE="lessclose.sh %s %s".  More complex  LESSOPEN  and
  971.      LESSCLOSE scripts may be written to also accept the filename
  972.      either with or without the .Z suffix,  or  to  accept  other
  973.      types of compressed files, and so on.
  974.  
  975.  
  976. NATIONAL CHARACTER SETS
  977.      There are three types of characters in the input file:
  978.  
  979.      normal characters
  980.           can be displayed directly to the screen.
  981.  
  982.      control characters
  983.           should not be displayed directly, but are  expected  to
  984.  
  985.  
  986.  
  987.                                                                15
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. LESS(1)                  USER COMMANDS                    LESS(1)
  995.  
  996.  
  997.  
  998.           be  found in ordinary text files (such as backspace and
  999.           tab).
  1000.  
  1001.      binary characters
  1002.           should not be displayed directly and are  not  expected
  1003.           to be found in text files.
  1004.  
  1005.      A "character set" is simply a description of  which  charac-
  1006.      ters  are to be considered normal, control, and binary.  The
  1007.      LESSCHARSET environment variable may be  used  to  select  a
  1008.      character set.  Possible values for LESSCHARSET are:
  1009.  
  1010.      ascii
  1011.           The default  character  set.   BS,  TAB,  NL,  CR,  and
  1012.           formfeed  are control characters, all chars with values
  1013.           between 127 and 255 are binary, and all others are nor-
  1014.           mal.
  1015.  
  1016.      latin1
  1017.           Selects the ISO 8859/1 character set.  latin-1  is  the
  1018.           same  as  ASCII,  except characters between 161 and 255
  1019.           are treated as normal characters.
  1020.  
  1021.      dos  Selects a character set appropriate for MS-DOS.
  1022.  
  1023.      In special cases, it may be desired to tailor _l_e_s_s to use  a
  1024.      character  set other than the ones definable by LESSCHARSET.
  1025.      In this case, the environment variable  LESSCHARDEF  can  be
  1026.      used  to  define  a  character  set.   It should be set to a
  1027.      string where each character in  the  string  represents  one
  1028.      character  in  the character set.  The character "." is used
  1029.      for a normal character, "c" for control, and "b" for binary.
  1030.      A  decimal  number may be used for repetition.  For example,
  1031.      "bccc4b." would mean character 0 is binary, 1, 2 and  3  are
  1032.      control,  4,  5,  6  and 7 are binary, and 8 is normal.  All
  1033.      characters after the last are taken to be the  same  as  the
  1034.      last, so characters 9 through 255 would be normal.  (This is
  1035.      an example, and does  not  necessarily  represent  any  real
  1036.      character set.)
  1037.  
  1038.      Setting LESSCHARDEF to "8bcccbcc18b95.b" is the same as set-
  1039.      ting   LESSCHARSET   to  "ascii".   Setting  LESSCHARDEF  to
  1040.      "8bcccbcc18b95.33b." is the same as setting  LESSCHARSET  to
  1041.      "latin1".
  1042.  
  1043.      If neither LESSCHARSET nor LESSCHARDEF is set, but your sys-
  1044.      tem  supports  the _s_e_t_l_o_c_a_l_e interface, _l_e_s_s will use setlo-
  1045.      cale to determine the  character  set.   setlocale  is  con-
  1046.      trolled  by  setting  the LANG or LC_CTYPE environment vari-
  1047.      ables.
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                                                16
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. LESS(1)                  USER COMMANDS                    LESS(1)
  1061.  
  1062.  
  1063.  
  1064.      Control and binary  characters  are  displayed  in  standout
  1065.      (reverse  video).  Each such character is displayed in caret
  1066.      notation if possible (e.g. ^A for control-A).   Caret  nota-
  1067.      tion  is  used  only  if inverting the 0100 bit results in a
  1068.      normal printable character.   Otherwise,  the  character  is
  1069.      displayed  as  a  hex number in angle brackets.  This format
  1070.      can be changed by setting the LESSBINFMT  environment  vari-
  1071.      able.   LESSBINFMT may begin with a "*" and one character to
  1072.      select the display attribute:  "*k"  is  blinking,  "*d"  is
  1073.      bold,  "*u"  is underlined, "*s" is standout.  If LESSBINFMT
  1074.      does not begin with a "*", normal attribute is assumed.  The
  1075.      remainder  of  LESSBINFMT  is a string which may include one
  1076.      printf-style escape sequence (a % followed by x,  X,  o,  d,
  1077.      etc.).  For example, if LESSBINFMT is "*u[%x]", binary char-
  1078.      acters are displayed in underlined hexadecimal surrounded by
  1079.      brackets.   The  default  if  no  LESSBINFMT is specified is
  1080.      "*d<%X>".
  1081.  
  1082.  
  1083. PROMPTS
  1084.      The -P option allows  you  to  tailor  the  prompt  to  your
  1085.      preference.   The string given to the -P option replaces the
  1086.      specified prompt string.  Certain characters in  the  string
  1087.      are  interpreted  specially.  The prompt mechanism is rather
  1088.      complicated to provide flexibility, but  the  ordinary  user
  1089.      need not understand the details of constructing personalized
  1090.      prompt strings.
  1091.  
  1092.      A percent sign followed by a single  character  is  expanded
  1093.      according to what the following character is:
  1094.  
  1095.      %b_X  Replaced by the byte  offset  into  the  current  input
  1096.           file.   The  b is followed by a single character (shown
  1097.           as _X above) which specifies the line whose byte  offset
  1098.           is  to  be  used.   If the character is a "t", the byte
  1099.           offset of the top line in the display is used,  an  "m"
  1100.           means  use  the middle line, a "b" means use the bottom
  1101.           line, a "B" means use the line just  after  the  bottom
  1102.           line,  and a "j" means use the "target" line, as speci-
  1103.           fied by the -j option.
  1104.  
  1105.      %B   Replaced by the size of the current input file.
  1106.  
  1107.      %E   Replaced by the name of the  editor  (from  the  EDITOR
  1108.           environment  variable).   See  the  discussion  of  the
  1109.           LESSEDIT feature below.
  1110.  
  1111.      %f   Replaced by the name of the current input file.
  1112.  
  1113.      %i   Replaced by the index of the current file in  the  list
  1114.           of input files.
  1115.  
  1116.  
  1117.  
  1118.  
  1119.                                                                17
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. LESS(1)                  USER COMMANDS                    LESS(1)
  1127.  
  1128.  
  1129.  
  1130.      %l_X  Replaced by the line number of  a  line  in  the  input
  1131.           file.   The  line to be used is determined by the _X, as
  1132.           with the %b option.
  1133.  
  1134.      %L   Replaced by the line number of the  last  line  in  the
  1135.           input file.
  1136.  
  1137.      %m   Replaced by the total number of input files.
  1138.  
  1139.      %p_X  Replaced by the percent into the  current  input  file.
  1140.           The  line  used  is  determined by the _X as with the %b
  1141.           option.
  1142.  
  1143.      %s   Same as %B.
  1144.  
  1145.      %t   Causes any trailing spaces to be removed.  Usually used
  1146.           at the end of the string, but may appear anywhere.
  1147.  
  1148.      %x   Replaced by the name of the  next  input  file  in  the
  1149.           list.
  1150.  
  1151.      If any item is unknown (for example, the file size if  input
  1152.      is a pipe), a question mark is printed instead.
  1153.  
  1154.      The format of the prompt string can be changed depending  on
  1155.      certain  conditions.   A  question mark followed by a single
  1156.      character acts like an  "IF":  depending  on  the  following
  1157.      character,  a  condition  is evaluated.  If the condition is
  1158.      true, any characters following the question mark and  condi-
  1159.      tion  character, up to a period, are included in the prompt.
  1160.      If the condition is false, such characters are not included.
  1161.      A  colon  appearing between the question mark and the period
  1162.      can be used to establish an "ELSE": any  characters  between
  1163.      the  colon  and the period are included in the string if and
  1164.      only if the IF condition  is  false.   Condition  characters
  1165.      (which follow a question mark) may be:
  1166.  
  1167.      ?a   True if any characters have been included in the prompt
  1168.           so far.
  1169.  
  1170.      ?b_X  True if the byte offset of the specified line is known.
  1171.  
  1172.      ?B   True if the size of current input file is known.
  1173.  
  1174.      ?e   True if at end-of-file.
  1175.  
  1176.      ?f   True if there is an input filename (that is,  if  input
  1177.           is not a pipe).
  1178.  
  1179.      ?l_X  True if the line number of the specified line is known.
  1180.  
  1181.      ?L   True if the line number of the last line in the file is
  1182.  
  1183.  
  1184.  
  1185.                                                                18
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. LESS(1)                  USER COMMANDS                    LESS(1)
  1193.  
  1194.  
  1195.  
  1196.           known.
  1197.  
  1198.      ?m   True if there is more than one input file.
  1199.  
  1200.      ?n   True if this is the first prompt in a new input file.
  1201.  
  1202.      ?p_X  True if the percent into the current input file of  the
  1203.           specified line is known.
  1204.  
  1205.      ?s   Same as "?B".
  1206.  
  1207.      ?x   True if there is a next input file  (that  is,  if  the
  1208.           current input file is not the last one).
  1209.  
  1210.      Any characters other than the special ones  (question  mark,
  1211.      colon, period, percent, and backslash) become literally part
  1212.      of the  prompt.   Any  of  the  special  characters  may  be
  1213.      included  in  the  prompt  literally  by preceding it with a
  1214.      backslash.
  1215.  
  1216.      Some examples:
  1217.  
  1218.      ?f%f:Standard input.
  1219.  
  1220.      This prompt prints the filename,  if  known;  otherwise  the
  1221.      string "Standard input".
  1222.  
  1223.      ?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-...
  1224.  
  1225.      This  prompt  would  print  the  filename,  if  known.   The
  1226.      filename is followed by the line number, if known, otherwise
  1227.      the percent if known, otherwise the byte  offset  if  known.
  1228.      Otherwise, a dash is printed.  Notice how each question mark
  1229.      has a matching period, and  how  the  %  after  the  %pt  is
  1230.      included literally by escaping it with a backslash.
  1231.  
  1232.      ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x..%t
  1233.  
  1234.      This prints the filename if this is the first  prompt  in  a
  1235.      file, followed by the "file N of N" message if there is more
  1236.      than one input file.  Then, if we are  at  end-of-file,  the
  1237.      string  "(END)"  is printed followed by the name of the next
  1238.      file, if there is one.  Finally,  any  trailing  spaces  are
  1239.      truncated.  This is the default prompt.  For reference, here
  1240.      are the defaults for  the  other  two  prompts  (-m  and  -M
  1241.      respectively).   Each is broken into two lines here for rea-
  1242.      dability only.
  1243.  
  1244.      ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\: %x.:
  1245.           ?pB%pB\%:byte %bB?s/%s...%t
  1246.  
  1247.      ?f%f .?n?m(file %i of %m) ..?ltline %lt?L/%L. :byte %bB?s/%s. .
  1248.  
  1249.  
  1250.  
  1251.                                                                19
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. LESS(1)                  USER COMMANDS                    LESS(1)
  1259.  
  1260.  
  1261.  
  1262.           ?e(END) ?x- Next\: %x.:?pB%pB\%..%t
  1263.  
  1264.      And here is the default message produced by the = command:
  1265.  
  1266.      ?f%f .?m(file %i of %m) .?ltline %lt?L/%L. .
  1267.           byte %bB?s/%s. ?e(END) :?pB%pB\%..%t
  1268.  
  1269.      The prompt expansion features are also used for another pur-
  1270.      pose:  if an environment variable LESSEDIT is defined, it is
  1271.      used as the command to be executed when  the  v  command  is
  1272.      invoked.  The LESSEDIT string is expanded in the same way as
  1273.      the prompt strings.  The default value for LESSEDIT is:
  1274.  
  1275.           %E ?lm+%lm. %f
  1276.  
  1277.      Note that this expands to the editor name, followed by  a  +
  1278.      and  the  line  number,  followed by the file name.  If your
  1279.      editor does not accept  the  "+linenumber"  syntax,  or  has
  1280.      other  differences  in invocation syntax, the LESSEDIT vari-
  1281.      able can be changed to modify this default.
  1282.  
  1283.  
  1284. ENVIRONMENT VARIABLES
  1285.      COLUMNS
  1286.           Sets the number of columns on the screen.   Takes  pre-
  1287.           cedence  over  the  number  of columns specified by the
  1288.           TERM variable.  (But if you  have  a  windowing  system
  1289.           which  supports  TIOCGWINSZ  or  WIOCGETD,  the  window
  1290.           system's idea of the screen size takes precedence  over
  1291.           the LINES and COLUMNS environment variables.)
  1292.  
  1293.      EDITOR
  1294.           The name of the editor (used for the v command).
  1295.  
  1296.      HOME Name of the user's home directory (used to find a .less
  1297.           file).
  1298.  
  1299.      LANG Language for determining the character set.
  1300.  
  1301.      LC_CTYPE
  1302.           Language for determining the character set.
  1303.  
  1304.      LESS Flags which are passed to _l_e_s_s automatically.
  1305.  
  1306.      LESSBINFMT
  1307.           Format for displaying non-printable, non-control  char-
  1308.           acters.
  1309.  
  1310.      LESSCHARDEF
  1311.           Defines a character set.
  1312.  
  1313.      LESSCHARSET
  1314.  
  1315.  
  1316.  
  1317.                                                                20
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. LESS(1)                  USER COMMANDS                    LESS(1)
  1325.  
  1326.  
  1327.  
  1328.           Selects a predefined character set.
  1329.  
  1330.      LESSCLOSE
  1331.           Command  line   to   invoke   the   (optional)   input-
  1332.           postprocessor.
  1333.  
  1334.      LESSEDIT
  1335.           Editor prototype string (used for the v command).   See
  1336.           discussion under PROMPTS.
  1337.  
  1338.      LESSHELP
  1339.           Name of the help file.
  1340.  
  1341.      LESSOPEN
  1342.           Command  line   to   invoke   the   (optional)   input-
  1343.           preprocessor.
  1344.  
  1345.      LINES
  1346.           Sets the number of lines on  the  screen.   Takes  pre-
  1347.           cedence  over the number of lines specified by the TERM
  1348.           variable.
  1349.  
  1350.      SHELL
  1351.           The shell used to execute the ! command, as well as  to
  1352.           expand filenames.
  1353.  
  1354.      TERM The type of terminal on which _l_e_s_s is being run.
  1355.  
  1356.  
  1357. SEE ALSO
  1358.      lesskey(1)
  1359.  
  1360.  
  1361. WARNINGS
  1362.      The = command and prompts (unless changed by -P) report  the
  1363.      line  number  of  the line at the top of the screen, but the
  1364.      byte and percent of the line at the bottom of the screen.
  1365.  
  1366.      If the :e command is used to name more than  one  file,  and
  1367.      one  of  the named files has been viewed previously, the new
  1368.      files may be entered into the list in an unexpected order.
  1369.  
  1370.      If a line longer than the screen width  is  split  (folded),
  1371.      and  a  search  matches  text which straddles the split, the
  1372.      matching text will not be highlighted.   In  certain  cases,
  1373.      patterns   beginning   with  a  ^  may  not  be  highlighted
  1374.      correctly.  Patterns which include a TAB character  may  not
  1375.      be  highlighted  correctly.  If a search is done using the !
  1376.      operator for text NOT matching a pattern, the strings  which
  1377.      do match the pattern are highlighted.  In all cases, even if
  1378.      the highlighting is incorrect, the text will nevertheless be
  1379.      found correctly by the search.
  1380.  
  1381.  
  1382.  
  1383.                                                                21
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. LESS(1)                  USER COMMANDS                    LESS(1)
  1391.  
  1392.  
  1393.  
  1394. COPYRIGHT
  1395.      Copyright (c) 1984,1985,1989,1994  Mark Nudelman
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.                                                                22
  1450.  
  1451.  
  1452.  
  1453.